using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using DifferenceEngine;

namespace IISAutoDeployment
{
    /// <summary>
    /// Abstraction of the DiffView ListView into observable object used in WPF
    /// </summary>
    public class DiffView
    {
        public readonly ListViewItem LineNumber;
        public readonly ListViewItem TextLine;

        public DiffView(ListViewItem lineNumber, ListViewItem textLine)
        {
            if (lineNumber == null && textLine == null)
            {
                LineNumber = new ListViewItem {Content = "Line #"};
                TextLine = new ListViewItem {Content = "Text"};
            }
            LineNumber = lineNumber;
            TextLine = textLine;
        }

        public object Text
        {
            get { return TextLine; }
        }

        public object Line
        {
            get { return LineNumber; }
        }
    }
    /// <summary>
    /// Abstraction of a list of DiffViews into observable collection used in WPF
    /// </summary>
    public class DiffViews : ObservableCollection<DiffView>
    {
        public IList<DiffView> DiffViewsList;

        public DiffViews()
        {
            DiffViewsList = new List<DiffView> { new DiffView(null, null) };
        }
    }
    /// <summary>
    /// DiffViewResults object which stores all the necessary information to build a results window
    /// </summary>
    public class DiffViewResults
    {
        public readonly DiffListTextFile FileA;
        public readonly DiffListTextFile FileB;
        public readonly double Time;
        public readonly ArrayList ArrayList;
        public bool FirstTimeDeploy = false;

        public DiffViewResults(DiffListTextFile fileA, DiffListTextFile fileB, double time, ArrayList arrayList)
        {
            FileA = fileA;
            FileB = fileB;
            Time = time;
            ArrayList = arrayList;
            if (FileA == null)
                FirstTimeDeploy = true;
        }
    }
}